package com.examination.system.administration.response;

import com.examination.framework.model.response.ResultCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

/**
 * @author 寇淇芮
 * @Date 2019/8/27 14:58
 */
@ToString
@ApiModel
public enum AreaTypeCode implements ResultCode {
    FAIL(false,120001,"操作失败"),
    SUCCESS(true,120002,"操作成功"),
    WITHSEVERALEXCEPTIONS(false,120003,"掺数正确请核实掺数"),
    NAMENULLEXCEPTIONS(false,120004,"名称不能为空活空白符"),
    NAMEREPETITION(false,120005,"名称重复"),
    IDNULLEXCEPTIONS(false,120006,"传入的id不正确"),
    DATABYIDNULLEXCEPTIONS(false,120007,"数据库没有该记录无法修改");


    @ApiModelProperty(value = "操作是否成功", example = "true", required = true)
    private String message;
    @ApiModelProperty(value = "操作代码", example = "120002", required = true)
    private Integer code;
    @ApiModelProperty(value = "操作信息", example = "string", required = true)
    private Boolean success;

    private AreaTypeCode(Boolean success,Integer code,String message){
        this.code =code;
        this.message= message;
        this.success = success;

    }
    @Override
    public boolean success() {
        return this.success;
    }

    @Override
    public int code() {
        return this.code;
    }

    @Override
    public String message() {
        return this.message;
    }
}
